package com.itheima.HomeWork;

import java.util.*;

public class Demo02 {
    public static void main(String[] args) {
        List<Integer> integers=new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            integers.add(i);
        }
        //顺序打印
        System.out.println(integers);
        //乱序后打印
        Collections.shuffle(integers);
        System.out.println(integers);
        //降序排序
        Collections.sort(integers, new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2-o1;
            }
        });
        System.out.println(integers);
    }
}
